//
//  FSNoteDetailCellCell.m
//  Trade
//
//  Created by 刘沿 on 16/4/13.
//  Copyright © 2016年 刘沿. All rights reserved.
//

#import "FSNoteDetailCellCell.h"

@implementation FSNoteDetailCellCell


+(instancetype)cellWihtTableView:(UITableView*)tableView{
    NSString * cellIdentifier = @"cellIdentifier";
    FSNoteDetailCellCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"FSNoteDetailCellCell" owner:nil options:nil] lastObject];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}

-(void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
    if (indexPath.section == 0) {
        switch (indexPath.row) {
            case 0:
                self.titleLabel.text = @"发布人:";
                self.desLabel.text =self.detailModel.creater;
                break;
            case 1:
                self.titleLabel.text = @"发布部门:";
                self.desLabel.text =self.detailModel.createOffice;
                break;
            case 2:
                self.titleLabel.text = @"发布时间:";
                self.desLabel.text =self.detailModel.createDate;
                break;
            case 3:
                self.titleLabel.text = @"标题:";
                self.desLabel.text = self.detailModel.title;
                break;
            case 4:
                self.titleLabel.text = @"内容:";
                self.desLabel.text = [self filterString:self.detailModel.content];
                break;
            default:
                break;
        }
        
    }else{
        self.titleLabel.text = @"";
        self.desLabel.text =@"";
    }
    
    
}

-(NSString*)filterString:(NSString*)content{
    
    NSString * tempString = [content stringByReplacingOccurrencesOfString:@"&#xd;" withString:@""];
    
    return tempString;
}


@end
